<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>01-jQuery对象进行方法扩展</title>
    <script  src="../../../jquery-3.6.0.min.js"></script>
    <script type="text/javascript">

        $.fn.extend({

            checked:function () {
            	this.prop("checked",true)
            },

            unchecked:function () {
	            this.prop("checked",false)
            }
        });

        $(function () {
        	$('#btn-check').click(function () {
		        $("input[type='checkbox']").checked()
	        })

	        $('#btn-uncheck').click(function () {
		        $("input[type='checkbox']").unchecked()
	        })
        })
    </script>
</head>
<body>
<input id="btn-check" type="button" value="点击选中复选框" onclick="checkFn()">
<input id="btn-uncheck" type="button" value="点击取消复选框选中" onclick="uncheckFn()">
<br/>
<input type="checkbox" value="football">足球
<input type="checkbox" value="basketball">篮球
<input type="checkbox" value="volleyball">排球

</body>
</html>

